/*
 * Created on 2004-5-13
 */
package jaoso.framework.dao.hibernate;

import jaoso.framework.dao.BaseDAO;
import jaoso.framework.dao.PersistentManager;

import jaoso.framework.exception.DAOException;

//import org.apache.commons.logging.Log;
//import org.apache.commons.logging.LogFactory;

/**
 * @author edgeloner edgeloner@163.com
 *  
 */
public class PersistentManagerImpl implements PersistentManager
{
    /**
     * DOCUMENT ME!
     */
    //private static Log log = LogFactory.getLog(PersistentManagerImpl.class);

    /**
     * DOCUMENT ME!
     */
    private BaseDAO baseDAO;

    /**
     * DOCUMENT ME!
     * 
     * @param dao
     *            DOCUMENT ME!
     */
    public final void setBaseDAO(final BaseDAO dao)
    {
        this.baseDAO = dao;
    }

    /**
     * DOCUMENT ME!
     * 
     * @param obj
     *            DOCUMENT ME!
     * 
     * @throws DAOException
     *             DOCUMENT ME!
     */
    public final void create(final Object obj) throws DAOException
    {
        baseDAO.saveEntity(obj);
    }

    /**
     * DOCUMENT ME!
     * 
     * @param obj
     *            DOCUMENT ME!
     * 
     * @throws DAOException
     *             DOCUMENT ME!
     */
    public final void remove(final Object obj) throws DAOException
    {
        baseDAO.removeEntity(obj);
    }

    /**
     * DOCUMENT ME!
     * 
     * @param obj
     *            DOCUMENT ME!
     * 
     * @throws DAOException
     *             DOCUMENT ME!
     */
    public final void update(final Object obj) throws DAOException
    {
        baseDAO.updateEntity(obj);
    }
}